home *** CD-ROM | disk | FTP | other *** search
/ Gold Medal Software 1 / Gold Medal Software Volume 1 (Gold Medal) (1994).iso / prog / cextract.arj / CEXTRACT.TAR / cextract / Makefile.dist < prev    next >
Encoding:
Makefile  |  1993-08-08  |  5.7 KB  |  211 lines

  1. #
  2. #    This Makefile is for the cextract/cextdoc program.  If
  3. #    you should experience any problems please send mail to:
  4. #
  5. #            adb@bu.edu
  6. #
  7.  
  8. #    Adjust anything as needed
  9.  
  10. #    shell used by make [some make versions need this]
  11. SHELL    = /bin/sh
  12.  
  13. #    compiler to build programs with
  14. CC    = cc
  15.  
  16. #    C preprocessor, if you don't wish to use the default.
  17. #    [this line can usually be left commented out]
  18. #CPPFLG    = -DCPP=\"/lib/cpp\"
  19.  
  20. #    Flag to tell the C preprocessor to not strip out comments,
  21. #    if the default value is not correct.
  22. #    [this line can usually be left commented out]
  23. #CPPCMT    = -DCPP_COMMENTS=\"-C\"
  24.  
  25. #    If your system does not support pipes (have the "popen()"
  26. #    function), you should uncomment this line.  [You might need to
  27. #    carefully look at the definitions of PIPETMP_FMT and
  28. #    PIPEOUT_FMT in xtract.h]
  29. #PIPFLG    = -DNO_POPEN
  30.  
  31. #    Compiler options, such as '-O' for cc
  32. #     or '-O -g -Wall -ansi' for GNU compilers
  33. COPTS    = -O
  34.  
  35. #    sequence to get rid of ${RM} error messages [blank to see them]
  36. NULL    = 2>/dev/null
  37.  
  38. #    System information flags; give the proper settings for your
  39. #    machine.  You can also add:
  40. #
  41. #        -DSETBUFFER    if your system has setbuffer(3S)
  42. #                and you wish to use it, in the (slim?)
  43. #                hope of increasing performance.
  44. #
  45. #        -DNO_PERROR    if your system does not have the
  46. #                perror(3) function.
  47. #
  48. #SYSFLG    = -DBSD            # Most BSD derivatives
  49. #SYSFLG    = -DSYSV        # Most SysV derivatives
  50. SYSFLG    = -DSYSV -DBSD        # Sun OS 4.1
  51. #SYSFLG    = -DSYSV -DAIX        # IBM AIX operating systems
  52. #SYSFLG    = -DSYSV -DSGI        # Silicon Graphics machines
  53. #SYSFLG    = -DBSD -DULTRIX    # Digital Ultrix systems
  54. #SYSFLG    = -DSYSV -DCLIX        # Intergraph Clix operating systems
  55. #SYSFLG    = -DHPUX        # Hewlett Packard HPUX systems
  56. #SYSFLG    = -DSYSV -DXENIX    # Xenix SysV systems
  57. #SYSFLG    = -DBSD -DXENIX        # Xenix BSD systems (?)
  58. #SYSFLG    = -DVAXC -DVMS        # Digital VAX VMS machines
  59. #SYSFLG = -DBSD -U__STDC__    # Apollo sites aren't really ANSI (?)
  60.  
  61. #    final location of the executable
  62. BINDIR    = /usr/local/bin
  63.  
  64. #    prefix directory, such as "/mnt". usually left blank
  65. DESTDIR    =
  66.  
  67. #    settings for the manual pages, change as desired
  68. MANDIR    = /usr/man/man
  69. M1TAG    = 1
  70. M1DIR    = ${MANDIR}${M1TAG}
  71. M5TAG    = 5
  72. M5DIR    = ${MANDIR}${M5TAG}
  73.  
  74. #    name of the cextractor program
  75. CXTRACT    = cextract
  76.  
  77. #    name of the documentation extractor
  78. DOCTRG    = cextdoc
  79.  
  80. #    name of the cextrc configuration file
  81. RCFILE    = .cextrc
  82.  
  83. #    full path and name for the system level configuration file
  84. SYSRC    = /usr/local/lib/cext.config
  85.  
  86. #    == List of miscellaneous commands needed by make ==
  87. #
  88. #    check for the existence of a directory
  89. TESTDIR    = test -d
  90. #    create a new directory
  91. MKDIR    = mkdir
  92. #    install a file (used in INSTBIN and INSTMAN settings)
  93. INSTALL    = install
  94. #    echo any arguments to the standard output
  95. ECHO    = echo
  96. #    string editor
  97. SED    = sed
  98. #    search for any differences between two files
  99. DIFF    = diff
  100. #    produce readable ASCII from roff "man" source
  101. NROFF    = nroff -man
  102. #    remove any files [-f flag means to override permissions]
  103. RM    = /bin/rm -f
  104.  
  105. #    command to install the binaries
  106. INSTBIN    = ${INSTALL} -s
  107.  
  108. #    command to install the manual pages
  109. INSTMAN    = ${INSTALL} -m 444
  110.  
  111. #    set permission on the configuration file after installation
  112. CHMOD    = chmod 644
  113.  
  114. #    this command is used to create the "cextdoc" program.
  115. #    [If a symbolic link is available, use that, so it need
  116. #     not be remade each time.  Otherwise use a normal hard link,
  117. #     or just 'cp'.]
  118. LINK    = ln -s
  119.  
  120. #
  121. #===== end of configurables
  122. #
  123.  
  124. #    list of object files
  125. CXTOBJS    = main.o parse.o io.o
  126.  
  127. #    command to build everything
  128. all:    ${CXTRACT}
  129.     @${ECHO} all targets done
  130.  
  131. #    install the binary
  132. install:    ${CXTRACT} ${SYSRC}
  133.     ${TESTDIR} ${DESTDIR}${BINDIR} || ${MKDIR} ${DESTDIR}${BINDIR}
  134.     ${INSTBIN} ${CXTRACT} ${DESTDIR}${BINDIR}
  135.     -(cd ${DESTDIR}${BINDIR}; ${RM} ${DOCTRG} ${NULL}; ${LINK} ${CXTRACT} ${DOCTRG})
  136.  
  137. #    install the manual pages
  138. install.man:    cextract.tman cextrc.tman cextdoc.tman
  139.     ${TESTDIR} ${DESTDIR}${M1DIR} || ${MKDIR} ${DESTDIR}${M1DIR}
  140.     ${TESTDIR} ${DESTDIR}${M5DIR} || ${MKDIR} ${DESTDIR}${M5DIR}
  141.     ${INSTMAN} cextract.tman ${DESTDIR}${M1DIR}/cextract.${M1TAG}
  142.     ${INSTMAN} cextdoc.tman ${DESTDIR}${M1DIR}/cextdoc.${M1TAG}
  143.     ${INSTMAN} cextrc.tman ${DESTDIR}${M5DIR}/cextrc.${M5TAG}
  144.  
  145. #    build up the documentation
  146. docs:    cextract.tman cextrc.tman
  147.     ${NROFF} cextract.tman > cextract.doc
  148.     ${NROFF} cextrc.tman > cextrc.doc
  149.  
  150. cextract.tman:    cextract.1 tmp.sed
  151.     ${SED} -f tmp.sed cextract.1 > cextract.tman
  152.  
  153. cextrc.tman:    cextrc.5 tmp.sed
  154.     ${SED} -f tmp.sed cextrc.5 > cextrc.tman
  155.  
  156. cextdoc.tman:    cextdoc.1 tmp.sed
  157.     ${SED} -f tmp.sed cextdoc.1 > cextdoc.tman
  158.  
  159. tmp.sed:
  160.     ${ECHO} "s;SYSCXTRC;${SYSRC};g" > tmp.sed
  161.     ${ECHO} "s;NORMRC;${RCFILE};g" >> tmp.sed
  162.     ${ECHO} "s;CDOCNAME;${DOCTRG};g" >> tmp.sed
  163.  
  164. ${SYSRC}:    ${CXTRACT}
  165.     @${ECHO} "Building new system wide configuration file"
  166.     ./${CXTRACT} -B
  167.     ${CHMOD} ${SYSRC}
  168.  
  169. #    Cleaning things up
  170. clean:
  171.     ${RM} *.o *~ \#* ${NULL}
  172.  
  173. #    Really clean things up
  174. clobber:    clean
  175.     ${RM} ${CXTRACT} testproto.h tmp.sed cextract.tman cextrc.tman ${NULL}
  176.  
  177. #    Build the header file
  178. proto:    
  179.     ${CXTRACT} -o proto.h -H_proto_h_ -S +CFacPZ main.c io.c parse.c
  180.  
  181. #
  182. test:    ${CXTRACT} ${SYSRC}
  183.     ./${CXTRACT} -o testproto.h -H_proto_h_ -S +CFacPZ main.c io.c parse.c
  184.     @${ECHO} ===
  185.     @${ECHO} === The only output from the following command should show
  186.     @${ECHO} === two date strings at line 5 of both files.
  187.     @${ECHO} ===
  188.     @${ECHO} === Errors from make can be ignored if this is the case.
  189.     @${ECHO} === 
  190.     -${DIFF} proto.h testproto.h
  191.  
  192. #
  193. #    define flags for the compilation
  194. CFLAGS    = -DSYS_CONFIG=\"${SYSRC}\" -DCONFIG_FILE=\"${RCFILE}\" -DCEXTDOC_NAME=\"${DOCTRG}\" ${CPPFLG} ${CPPCMT} ${PIPFLG}
  195.  
  196. #
  197. #    Rules and dependencies for this Makefile
  198. #
  199. .c.o:    $<
  200.     ${CC} ${SYSFLG} ${COPTS} ${CFLAGS} -c $*.c
  201.  
  202. #    The prototype extraction program
  203. ${CXTRACT}:    ${CXTOBJS}
  204.     ${CC} ${COPTS} -o ${CXTRACT} ${CXTOBJS}
  205.  
  206. #
  207. #    Added dependencies
  208. ${CXTOBJS}:    xtract.h proto.h
  209.  
  210. #
  211.